$(function () {
    let layer = layui.layer;
    // 判断token是否存在
    let res = localStorage.getItem("mytoken");
    if (res == null) {
        location.href = "/login.html";
    }


    // 退出按钮的点击事件
    $("#logout-btn").on("click", function () {
        layer.confirm('确定要退出?', function (index) {

            // 关闭弹窗
            layer.close(index);
            // *******************************************token的补丁3
            // 跳页面
            location.href = "/login.html";
            localStorage.removeItem("mytoken");
        });
    });

})